package com.bite.rabbitmq.listener;

import com.bite.rabbitmq.constant.Constants;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

//@Component
public class DelayListener {


    @RabbitListener(queues = Constants.DELAY_QUEUE)
    public void listener2(Message message) throws Exception {
        System.out.println("在" + new Date() + " 收到[" + Constants.DELAY_QUEUE + "]的消息 message: "
                + new String(message.getBody()));
    }
}
